package com.lingz.manager.modules.wuxue.controller;

import com.lingz.manager.base.DevplatBaseController;
import com.lingz.manager.base.DevplatBaseService;
import com.lingz.manager.common.utils.ResultUtil;
import com.lingz.manager.common.vo.Result;
import com.lingz.manager.modules.wuxue.entity.OpeEntInfo;
import com.lingz.manager.modules.wuxue.entity.TownGovInfo;
import com.lingz.manager.modules.wuxue.service.OpeEntInfoService;
import com.lingz.manager.modules.wuxue.service.TownGovInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@Api(description = "武穴政府部门接口")
@RequestMapping("/wuxue/towngovernment")
@Transactional
public class TownGovInfoController extends DevplatBaseController<TownGovInfo,String> {
    @Autowired
    TownGovInfoService townGovInfoService;
    @Override
    public TownGovInfoService getService(){return townGovInfoService;}
    @GetMapping("/findTownGovInfoById")
    @ApiOperation("根据id获取主体信息")
    public Result<TownGovInfo> findTownGovInfoById(int id){
        return new ResultUtil<TownGovInfo>().setData(townGovInfoService.findTownGovInfoById(id));
    }
    @GetMapping(value = "/findTownGovInfoList")
    @ApiOperation(value = "不分页查询主体信息")
    public Result<List<TownGovInfo>> findTownGovInfoList(TownGovInfo townGovInfo){
        return new ResultUtil<List<TownGovInfo>>().setData(townGovInfoService.findListTownGovInfo(townGovInfo));
    }
}
